package lleida.festamajor.activities;

import lleida.festamajor.R;
import lleida.festamajor.controllers.EventController;
import android.os.Bundle;
import android.view.View;

import android.widget.TextView;

public class AMain extends FMActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ((TextView)findViewById(R.id.main_nombre)).setText(String.valueOf(EventController.getTotalEvents()) + " actes de Festa Major.");
        
        EventController.setAllSelectedPlaces();
    }
    
    public void onClickListener(View v) {
    	switch (v.getId()) {
    	case R.id.main_activitats:
    		app.showEvents();
    		break;
    	case R.id.main_anar:
    		app.showPlace();
    		break;
    	}
    }
    
    public void onResume() {
    	super.onResume();
    	EventController.setAllSelectedPlaces();
    }
}